package org.gruposp2p.dnie.client.ui.panel;

import org.gruposp2p.dnie.client.ui.widget.dynatable.LastDocumentsWidget;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;

public class LastDocumentsPanel extends Composite {

    private static LastDocumentsPanelUiBinder uiBinder = GWT
                    .create(LastDocumentsPanelUiBinder.class);

    @UiField VerticalPanel contentPanel;
    LastDocumentsWidget lastDocumentsToSign;

    interface LastDocumentsPanelUiBinder extends
            UiBinder<Widget, LastDocumentsPanel> {}

    public LastDocumentsPanel() {
        initWidget(uiBinder.createAndBindUi(this));
        contentPanel.setWidth("991px");
    }

    public LastDocumentsPanel getInstance () {
        if (lastDocumentsToSign == null) {
            lastDocumentsToSign = new LastDocumentsWidget(10);
            contentPanel.add(lastDocumentsToSign);
        }
        return this;
    }
}
